﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true"
    CodeBehind="list.aspx.cs" Inherits="Maticsoft.Web.Admin.Link.list" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        $(function () {
            $("#chk_all").click(function () {
                $("input[name=chk_list]").each(function () {
                    $(this).attr("checked", true);
                })
            });
            $("#chk_no").click(function () {
                $("input[name=chk_list]").each(function () {
                    $(this).attr("checked", false);
                })
            })
        })
        function Del() {
                var ids = "";
                $("#lists input:checkbox").each(function () {
                    if ($(this).attr("checked") == true) {
                        if (ids.length > 0) {
                            ids += ",";
                        }
                        ids += $(this).val();
                    }
                })
                if (ids.length > 0) {
                    if (confirm("确认删除？")) {
                        $("#ctl00_ContentPlaceHolder1_txtIds").val(ids);
                        return true;
                    }
                    else {
                        return false;
                    }
                }
                else {
                    alert("请选择要删除记录");
                    return false;
                }
        }
    </script>
    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#111111"
        style="border-collapse: collapse">
        <tr>
            <td width="100%" height="20" valign="top">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td height="30">
                            <img height="14" src="../images/book1.gif" width="20">&nbsp;友情链接&nbsp;&gt;&gt;&nbsp;列表
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td width="100%" height="1" background="../images/sp_bg.gif">
            </td>
        </tr>
    </table>
    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td height="10">
            </td>
        </tr>
    </table>
    <!--  快速转换位置按钮  -->
    <table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#ccd9b9" align="center">
        <tr>
            <td height="26" background="../images/newlinebg3.gif">
                <table width="98%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td align="left">
                            &nbsp;<input type='button' class="coolbg np" onclick="location='edit.aspx?act=add';"
                                value='添加链接' />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <!--  内容列表   -->
    <table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CFCFCF" align="center"
        style="margin-top: 8px" id="lists">
        <tr bgcolor="#E7E7E7">
            <td height="28" colspan="8" background="../images/tbg.gif" style="padding-left: 10px;">
                ◆ 友情链接&gt;链接列表
            </td>
        </tr>
        <tr align="center" bgcolor="#FBFCE2" height="25">
            <td width="4%">
                选择
            </td>
            <td width="6%">
                ID
            </td>
            <td>
                标题
            </td>
            <td width="5%">
                类别
            </td>
            <td width="5%">
                排序
            </td>
            <td width="13%">
                图片
            </td>
            <td width="15%">
                添加时间
            </td>
            <td width="8%">
                操作
            </td>
        </tr>
        <asp:Repeater ID="Repeater1" runat="server">
            <ItemTemplate>
                <tr align='center' bgcolor="#FFFFFF" height="26" align="center" onmousemove="javascript:this.bgColor='#FCFDEE';"
                    onmouseout="javascript:this.bgColor='#FFFFFF';">
                    <td>
                        <input name="chk_list" type="checkbox" id="chk_list" class="np" value="<%#Eval("LinkId") %>" />
                    </td>
                    <td>
                        <%#Eval("LinkId") %>
                    </td>
                    <td align='left'>
                        <a href="edit.aspx?act=edit&id=<%#Eval("LinkId") %>">
                            <%#Eval("Title") %> </a>
                    </td>
                    <td>
                        <%#Eval("Type").ToString()=="0" ? "文字" : "图片" %>
                    </td>
                    <td>
                        <%#Eval("OrderNo") %>
                    </td>
                    <td>
                        <img src="<%#!string.IsNullOrEmpty(Convert.ToString(Eval("Pic"))) ? "/uploadfiles/links/"+Eval("Pic") : "img/nopic.gif" %>"
                            width="88" height="31" />
                    </td>
                    <td>
                        <%#Eval("CreateTime") %>
                    </td>
                    <td>
                        <a href="edit.aspx?act=edit&id=<%#Eval("LinkId") %>">修改</a>
                    </td>
                </tr>
            </ItemTemplate>
        </asp:Repeater>
        <tr bgcolor="#ffffff">
            <td height="36" colspan="8">
                &nbsp; <a href="javascript:void(0);" id="chk_all" class="coolbg">全选</a> <a href="javascript:void(0);"
                    class="coolbg" id="chk_no">取消</a>
                <asp:LinkButton ID="LinkButton1" runat="server" class="coolbg" OnClick="LinkButton1_Click"
                    OnClientClick="return Del();">删除</asp:LinkButton><input id="txtIds" type="text" runat="server"
                        style="display: none" />
            </td>
        </tr>
        <tr align="right" bgcolor="#F9FCEF">
            <td height="36" colspan="8" align="center">
                <webdiyer:AspNetPager ID="AspNetPager1" runat="server" Width="100%" UrlPaging="true" ShowPageIndexBox="Always" PageIndexBoxType="DropDownList" TextBeforePageIndexBox="转到: " HorizontalAlign="center" PageSize="10" OnPageChanged="AspNetPager1_PageChanged" EnableTheming="true">
                </webdiyer:AspNetPager>
            </td>
        </tr>
    </table>
    <table width='98%' border='0' cellpadding='1' cellspacing='1' bgcolor='#cfcfcf' align="center"
        style="margin-top: 8px">
        <tr bgcolor='#EEF4EA'>
            <td background='../images/wbg.gif' align='center'>
                <table border='0' cellpadding='0' cellspacing='0' height="32">
                    <tr>
                        <td>
                            关键字：
                        </td>
                        <td width="130">
                            <input type='text' name='txtKey' id="txtKey" value='' style='width: 120px' runat="server" />
                        </td>
                        <td>
                            <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="../images/button_search.gif"
                                class="np" Width="60px" Height="22px" OnClick="ImageButton1_Click" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</asp:Content>
